Skip to content

Skip empty checksum values in compact index metadata#9713

Merged
hsbt merged 2 commits into
masterfrom
empty-checksum-metadata
Jul 23, 2026
Merged

Skip empty checksum values in compact index metadata#9713
hsbt merged 2 commits into
masterfrom
empty-checksum-metadata

Conversation

@hsbt

@hsbt hsbt commented Jul 22, 2026

Copy link
Copy Markdown
Member

Compact index /info files served by some registries such as GitHub Package Registry can contain empty checksum entries like 2.0.1 |checksum:. The parser turns that into ["checksum", []] and EndpointSpecification#parse_metadata passed the resulting nil digest to Checksum.from_api, crashing resolution with a NoMethodError wrapped in a GemspecError. An empty or missing checksum value is now treated the same as an absent checksum key, so resolution continues with the checksum left unset. Non-empty invalid values still raise the existing Invalid checksum for ... error.

Fixes #9677

Some registries such as GitHub Package Registry serve /info files with
empty checksum entries like "2.0.1 |checksum:", which parse into an
empty array and crashed resolution with a NoMethodError on nil. Treat
an empty or missing checksum value the same as an absent checksum key,
while keeping the "Invalid checksum" error for non-empty invalid values.

Fixes #9677

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 22, 2026 05:51

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

The spec added in #9687 serialized the cached gemspec with the
in-process RubyGems, but `#to_ruby` output differs across RubyGems
versions, so it failed on the system RubyGems jobs where the file was
written by an older version. Serialize in a subprocess like the
sibling spec does.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 23, 2026 01:21

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@hsbt
hsbt merged commit b45f5b2 into master Jul 23, 2026
110 checks passed
@hsbt
hsbt deleted the empty-checksum-metadata branch July 23, 2026 01:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Gem with empty checksum throwing undefined method match? for nil

2 participants